<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Student_message</title>
</head>
<style>
    .layui-input {
        border: none;
        outline: none;
    }

    .stuMessage {
        width: 100%;
        border-bottom: 1px black solid;
        height: 50px;
    }
</style>
<body>
<div>
    <div th:each="studentMessageList: ${studentMessageList}">
        <div>
            <div class="stuMessage">
                <label class="layui-form-label" for="message"></label>
                <div class="layui-input-inline">
                    <input class="layui-input" id="message" name="message" th:value="${studentMessageList.message}"
                           type="text" value="">
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    window.onload = function () {
        const input = document.getElementsByClassName("layui-input");
        for (let i = 0; i < input.length; i++) {
            input[i].setAttribute('readonly', 'true');
        }
    }
</script>
</body>
</html>